<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>WebChannel (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">net.WebChannel</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    A WebChannel represents a logical bi-directional channel over which the
client communicates with a remote server that holds the other endpoint
of the channel. A WebChannel is always created in the context of a shared
<code> WebChannelTransport</code> instance. It is up to the underlying client-side
and server-side implementations to decide how or when multiplexing is
to be enabled.


  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_labs_net_webchannel.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/labs/net/webchannel.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td>goog.net.WebChannel</td><td></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
</table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.net.WebChannel(<span></span>)
  </div>



<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="interface_goog_net_WebChannel.html">
              goog.net.WebChannel
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.WebChannel.prototype.getRuntimeProperties"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getRuntimeProperties<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="interface_goog_net_WebChannel_RuntimeProperties.html">goog.net.WebChannel.RuntimeProperties</a></span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="interface_goog_net_WebChannel_RuntimeProperties.html">goog.net.WebChannel.RuntimeProperties</a></span>&nbsp;
            The runtime properties
of the WebChannel instance.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel.js.source.html#line211">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.net.WebChannel.prototype.send"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">send<span class="args">(<span class="arg">message</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sends a message to the server that maintains the other end point of
the WebChannel.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">message</span>
        : <span>!</span><span class="type">goog.net.WebChannel.MessageData</span>
        <div class="entryOverview">The message to send.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel.js.source.html#line125">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Instance Properties</h2>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="interface_goog_net_WebChannel.html">
              goog.net.WebChannel
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.WebChannel.prototype.close"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">close</span>
        : 
     </div>


     <div class="entryOverview">
       Close the WebChannel.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel.js.source.html#line116">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.WebChannel.prototype.open"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">open</span>
        : 
     </div>


     <div class="entryOverview">
       Open the WebChannel against the URI specified in the constructor.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel.js.source.html#line110">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>










<div class="section">
  <table class="horiz-rule">


  </table>
</div>



<h2>Static Properties</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.WebChannel.MessageData"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.WebChannel.</span><span class="entryName">MessageData</span>
        : 
     </div>


     <div class="entryOverview">
       Types that are allowed as message data.


     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel.js.source.html#line104">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.WebChannel.Options"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.WebChannel.</span><span class="entryName">Options</span>
        : 
     </div>


     <div class="entryOverview">
       Configuration spec for newly created WebChannel instances.

WebChannels are configured in the context of the containing
<code> WebChannelTransport</code>. The configuration parameters are specified
when a new instance of WebChannel is created via <code> WebChannelTransport</code>.

messageHeaders: custom headers to be added to every message sent to the
server.

messageUrlParams: custom url query parameters to be added to every message
sent to the server.

spdyRequestLimit: the maximum number of in-flight HTTP requests allowed
when SPDY is enabled. Currently we only detect SPDY in Chrome.
This parameter defaults to 10. When SPDY is not enabled, this parameter
will have no effect.

supportsCrossDomainXhr: setting this to true to allow the use of sub-domains
(as configured by the server) to send XHRs with the CORS withCredentials
bit set to true.

testUrl: the test URL for detecting connectivity during the initial
handshake. This parameter defaults to "//test".



     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel.js.source.html#line96">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



<h2>Enumerations</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.net.WebChannel.ErrorStatus"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.WebChannel.</span><span class="entryName">ErrorStatus</span>
        : 
     </div>


     <div class="entryOverview">
       WebChannel level error conditions.

     </div>

     <div class="entryDetails">
       <div class="detailsSection">
          <b>Constants:</b>
          <table class="horiz-rule">
            <tbody>
              <tr><td>
                <span class="entryName">
                  NETWORK_ERROR
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  OK
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  SERVER_ERROR
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
           </tbody>
         </table>
       </div>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel.js.source.html#line173">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.net.WebChannel.EventType"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.net.WebChannel.</span><span class="entryName">EventType</span>
        : 
     </div>


     <div class="entryOverview">
       Common events fired by WebChannels.

     </div>

     <div class="entryDetails">
       <div class="detailsSection">
          <b>Constants:</b>
          <table class="horiz-rule">
            <tbody>
              <tr><td>
                <span class="entryName">
                  CLOSE
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  ERROR
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  MESSAGE
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  OPEN
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
           </tbody>
         </table>
       </div>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel.js.source.html#line132">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package net</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="net.WebChannel"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
